package org.opensourcedea.gui.maingui;

import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.Shell;

import org.opensourcedea.gui.deaproblem.DEAPTabFolder;
import org.opensourcedea.gui.menu.OSDEA_Menu;

public class Main_GUI_Test {

  Display display;
  Shell shell;
  Label label;
  DEAPTabFolder deapTF;
  Image potIcon;
  
  public Main_GUI_Test() {

    display = new Display();
    shell = new Shell(display);
    shell.setText("OSDEA");
    
    potIcon = new Image(shell.getDisplay(), this.getClass().getResourceAsStream("pot2422-48x48x32.png"));
    shell.setImage(potIcon);
    
	deapTF = new DEAPTabFolder(shell);
    
    shell.setMenuBar(createMenu(shell));
    shell.setLayout(new FillLayout());
	shell.setSize(600,400);

    
    shell.open();
    while (!shell.isDisposed()) {
      if (!display.readAndDispatch())
        display.sleep();
    }
    
    potIcon.dispose();
    display.dispose();
  }
  
  public Menu createMenu(Shell shell){
	  
	  OSDEA_Menu createMenu = new OSDEA_Menu(shell, display, deapTF.getNavigationTab());
	  Menu menuBar = createMenu.getMenu(shell);
	  
	  return menuBar;
	  
  }


  @SuppressWarnings("unused")
  public static void main(String[] args) {
	  
	  Main_GUI_Test OSDEAGUI = new Main_GUI_Test();
	  
  }
  
}
